
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
        <input type="hidden" name="id" value="{$res.id}"/>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">广告位标题:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-adtitle" class="form-control" name="adtitle" type="text" value="{$res.adtitle}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">广告类型:</label>
        <div class="col-xs-12 col-sm-8">
            <input  name="adtype"  value="0" type="radio" {if condition="$res.adtype eq 0"}checked="checked"{/if} >自定义上传图片
            <input  name="adtype"  value="1" type="radio" {if condition="$res.adtype eq 1"}checked="checked"{/if}>产品选择
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">广告位说明:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea class="form-control" name="adinfo">{$res.adinfo}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">广告位标题:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-width" class="form-control" name="width" type="text" value="{$res.width}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">广告位标题:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-height" class="form-control" name="height" type="text" value="{$res.height}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" class="btn btn-success btn-embossed" onclick="sub();">确定</button>
            <a  href="/admin/adsense/index" class="btn btn-default btn-embossed">返回</a>
        </div>
    </div>
</form>

<script>
    function sub() {
        var adtitle=$("#c-adtitle").val();
        var width=$("#c-width").val();
        var height=$("#c-height").val();
        if(adtitle==''){
            alert("广告位标题不得为空");
            return;
        }
        if(width==''){
            alert("广告媒体宽不得为空");
            return;
        }
        if(height==''){
            alert("广告媒体高不得为空");
            return;
        }
        $("#edit-form").submit();

    }
</script>